---
title: Create a prompt
sidebarTitle: Create a prompt
---

Navigate to the  in the left-hand sidebar or from the application homepage.

![](/langsmith/images/empty-playground.png)

## Compose your prompt

On the left is an editable view of the prompt.

The prompt is made up of messages, each of which has a "role" - including `system`, `human`, and `ai`.

### Template format

The default template format is `f-string`, but you can change the prompt template format to `mustache` by clicking on the settings icon next to the model -> prompt format -> template format. Learn more about template formats [here](/langsmith/prompt-engineering-concepts#f-string-vs-mustache).
![](/langsmith/images/template-format.png)

### Add a template variable

The power of prompts comes from the ability to use variables in your prompt. You can use variables to add dynamic content to your prompt. Add a template variable in one of two ways:

1. Add `{{variable_name}}` to your prompt (with one curly brace on each side for `f-string` and two for `mustache`). ![](/langsmith/images/prompt-with-variable.png)

2. Highlight text you want to templatize and click the tooltip button that shows up. Enter a name for your variable, and convert. ![](/langsmith/images/convert-to-variable.gif)

When we add a variable, we see a place to enter sample inputs for our prompt variables. Fill these in with values to test the prompt. ![](/langsmith/images/prompt-inputs.png)

### Structured output

Adding an output schema to your prompt will get output in a structured format. Learn more about structured output [here](/langsmith/prompt-engineering-concepts#structured-output). ![](/langsmith/images/structured-output.png)

### Tools

You can also add a tool by clicking the `+ Tool` button at the bottom of the prompt editor. See [here](/langsmith/use-tools) for more information on how to use tools.

## Run the prompt

Click "Start" to run the prompt.

![](/langsmith/images/create-a-prompt-run.png)

## Save your prompt

To save your prompt, click the "Save" button, name your prompt, and decide if you want it to be "private" or "public". Private prompts are only visible to your workspace, while public prompts are discoverable to anyone.

The model and configuration you select in the Playground settings will be saved with the prompt. When you reopen the prompt, the model and configuration will automatically load from the saved version. ![](/langsmith/images/save-prompt.png)

<Check>
The first time you create a public prompt, you'll be asked to set a LangChain Hub handle. All your public prompts will be linked to this handle. In a shared workspace, this handle will be set for the whole workspace.
</Check>

![](/langsmith/images/public-handle.png)

## View your prompts

You've just created your first prompt! View a table of your prompts in the prompts tab.

![](/langsmith/images/prompt-table.png)

## Add metadata

To add metadata to your prompt, click the prompt and then click the "Edit" pencil icon next to the name. This brings you to where you can add additional information about the prompt, including a description, a README, and use cases. For public prompts this information will be visible to anyone who views your prompt in the LangChain Hub.

![](/langsmith/images/pencil.png) ![](/langsmith/images/edit-prompt.png)

# Next steps

Now that you've created a prompt, you can use it in your application code. See [how to pull a prompt programmatically](/langsmith/manage-prompts-programmatically#pull-a-prompt).
